﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using NS.Model.Systems;
using NS.Utilities;
using NS.BLL.Systems;
using BLL;
using Model;

public partial class Systems_InfoModify : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            BindData();
        }
    }

    //绑定数据源
    private void BindData()
    {
        Info Model = InfoService.GetInfoById(int.Parse(Request.QueryString["ID"]));
        txtTitle.Text = Model.Title;
        txtContents.Text = Model.Contents;
        txtRemarks.Text = Model.Remarks;
    }
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        if (UtilityService.UpdateFieldByPK("Info", "Title,Contents,Remarks", new Object[] { txtTitle.Text, txtContents.Text.Trim(), txtRemarks.Text }, "ID", Request.QueryString["ID"]) > 0)
        {
            MessageBox.ShowSaveSuccess(this);
        }
    }
}